<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html  xmlns="http://www.w3.org/1999/xhtml">
<head  >

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Responsive Bootstrap Advance Admin Template</title>

    <!-- BOOTSTRAP STYLES-->
    <link href="/my_xm/Public/Admin/assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="/my_xm/Public/Admin/assets/css/font-awesome.css" rel="stylesheet" />
       <!--CUSTOM BASIC STYLES-->
    <link href="/my_xm/Public/Admin/assets/css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="/my_xm/Public/Admin/assets/css/custom.css" rel="stylesheet" />

    <!-- GOOGLE FONTS-->
    <link rel="stylesheet" type="text/css" href="/my_xm/Public/Admin/assets/js/jquery.datetimepicker.css"/>


</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">COMPANY NAME</a>
            </div>

            <div class="header-right">

                <a href="message-task.html" class="btn btn-info" title="New Message"><b>30 </b><i class="fa fa-envelope-o fa-2x"></i></a>
                <a href="message-task.html" class="btn btn-primary" title="New Task"><b>40 </b><i class="fa fa-bars fa-2x"></i></a>
                <a href="login.html" class="btn btn-danger" title="Logout"><i class="fa fa-exclamation-circle fa-2x"></i></a>

            </div>
        </nav>
        <!-- /. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                    <?php if(is_array($top_nav)): foreach($top_nav as $key=>$v): ?><li>
                        <a href="#"><i class="fa fa-desktop "></i><?php echo ($v["name"]); ?><span class="fa arrow"></span></a>
                         <ul class="nav nav-second-level">
                            <?php if(is_array($child_nav)): foreach($child_nav as $key=>$vi): if(($v['id']) == $vi['pid']): ?><li>
                                <a href="<?php echo U($vi['url']);?>"><i class="fa fa-circle-o "></i><?php echo ($vi["name"]); ?></a>
                            </li><?php endif; endforeach; endif; ?>
                        </ul>
                    </li><?php endforeach; endif; ?>
                        </ul>
                    </li>

                </ul>

            </div>

        </nav>
        <!-- /. NAV SIDE  -->



     <div id="page-wrapper">
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-head-line">会员添加</h1>
                        <h1 class="page-subhead-line">This is dummy text , you can replace it with your original text. </h1>

                    </div>
                </div>
                <!-- /. ROW  -->
                <div class="row">

<div class="col-md-6 col-sm-6 col-xs-12">
               <div class="panel panel-danger">
                        <div class="panel-heading">
                           SINGUP FORM
                        </div>
                        <div class="panel-body">
                            <form role="form" id="signupForm" action="" method="post"  enctype="multipart/form-data" >


                                 <div class="form-group">
                                            <label>用户名</label>
                                            <input type="text" class="form-control" name="username">

                                     <p class="help-block ">Help text here.</p>
                                        </div>
                                         <div class="form-group">
                                            <label>角色</label>
                                            <select class="form-control" name="pid">
                                                <option value="0">顶级层</option>
                                               <?php if(is_array($group)): foreach($group as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["title"]); ?></option><?php endforeach; endif; ?>
                                            </select>
                                        </div>
                                            <div class="form-group">
                                            <label>密码</label>
                                            <input type="text" class="form-control" id="password"  name="password">
                                     <p class="help-block ">Help text here.</p>
                                        </div>
                                              <div class="form-group">
                                            <label>确认密码</label>
                                            <input type="text" class="form-control" name="password_again"  >
                                     <p class="help-block ">Help text here.</p>
                                        </div>
                                           <div class="form-group">
                                            <label>头像上传</label>
                                           <input type="file" multiple="" class="form-control" id="error" name="avathor" />
                                     <p class="help-block ">Help text here.</p>
                                        </div>


                                         <div class="form-group">
                                            <label>性别</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="sex" id="optionsRadios1" value="option1" checked="" required>男
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="sex" id="optionsRadios2" value="option2">女
                                                </label>
                                            </div>

                                        </div>
                                        <div class="form-group">
                                            <label>手机号</label>
                                            <input type="text" class="form-control" name="tell" id="tell">
                                          <input type="button" id="code" value="点击发送"></input>

                                     <p class="help-block ">Help text here.</p>
                                        </div>
                                    <p class="help-block">Help text here.</p>
                                         <input class="btn btn-danger" type="submit" value="提交 Now"  >
                                    </form>
                            </div>
                        </div>
                            </div>
        </div>
             <!--/.ROW-->

            </div>
            <!-- /. PAGE INNER  -->
        </div>
<style>
.error{
  color:red;
}
</style>
        









    </div>
    <!-- /. WRAPPER  -->

    <div id="footer-sec">
        &copy; 2014 YourCompany | More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
    </div>
    <!-- /. FOOTER  -->
    <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
    <!-- JQUERY SCRIPTS -->
    <script src="/my_xm/Public/Admin/assets/js/jquery-1.10.2.js"></script>
    <!-- BOOTSTRAP SCRIPTS -->
    <script src="/my_xm/Public/Admin/assets/js/bootstrap.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="/my_xm/Public/Admin/assets/js/jquery.metisMenu.js"></script>
       <!-- CUSTOM SCRIPTS -->
    <script src="/my_xm/Public/Admin/assets/js/custom.js"></script>



</body>
</html>

<script  type="text/javascript" src="/my_xm/Public/Admin/assets/js/jquery-1.10.2.js"></script>
 <script type="text/javascript" src="/my_xm/Public/Admin/assets/js/jquery.validate.min.js"/></script>

  <script type="text/javascript">
$(document).ready(function() {

// 在键盘按下并释放及提交后验证提交表单
  $("#signupForm").validate({
    // debug:true,
  //  errorElement: "span",
    rules: {
      username: {
        required: true,
        minlength: 2
      },
       password: {
        required: true,
        minlength: 5,

    },
    password_again:{
       equalTo:"#password"
      },
    },

    messages: {
        username: {  //错误提示信息
        required: " (必需字段)",
        minlength: " (不能少于 3 个字母)"
        },

        password: {
        required: "请输入密码",
        minlength: "密码长度不能小于 5 个字母"
        },
        password_again:{
       equalTo:"请输入与密码一样的值"
      },

  },
  errorElement:'p',
  errorClass:'error',
  })


  // 短信验证

$('#code').click(function(event) {

  var s=10;
  var time=0;
  var code=$(this);
  var tell=$('#tell').val();
 // alert(tell);
  $.ajax({
    url:"<?php echo U('admin/ajax/send_sms');?>",
    data:{
      'tell':tell,
    },
    type:'post',
    success:function(yan){

   //alert(yan)
      if(yan>0){
        alert("发送成功");
      }else{
        alert("发送失败");
      }
    }

  })
time=setInterval(function(){
    if (s>0) {
      var t=s+'秒后可重新发送';
      code.val(t);
      code.attr('disabled','disabled');
      s--;
    }else{
      s=10;
       var t='点击即可发送验证码';
      code.val(t);
      code.attr('disabled',false);
      clearInterval(time);

    }



},1000)

})
})

        </script>